<%@ page language="java" pageEncoding="UTF-8"%>
<html>
	<head>
		<%@ include file="/common/CimsCommon.jsp" %>
		<link rel="stylesheet" href="<%=basePath%>/css/cims/style.css">
		<style type="text/css">
			th{
				width:200px;
			}
			td input[name=address]{
				width:400px !important;
			}
		</style>
	</head>
	<body style="background-color:#FFFFFF">
		<form id="partner_detail" name="partner_detail" isCheck="true">
			<div id="formPageSwap">
				<input type="hidden" class="text" id="dtoid" name="id" notNull="false" maxLength="11" value="${dto.id}" />
				<div style="width: 100%;" id="formSwap">
					<div class="expandSwap">
						<div class="ui-widget-header ui-corner-all">
							<span class="text">合作机构详情</span><span class="expandBtn"></span>
						</div>
						<div class="expandContent">
							<table class="formTableSwap" border="0" align="center" id="investinfo"
								cellpadding="0" cellspacing="1">
								<tr>
									<th><p>合作机构编号</p></th>
									<td>
										<input name="cooperorgCode" type="text" class="noborder" notNull="false"
											   maxLength=32 value="${dto.cooperorgCode}" />
									</td>
									<th><p>合作机构名称</p></th>
									<td>
										<input name="cooperorgName" type="text" class="noborder" notNull="true"
											   maxLength=128 value="${dto.cooperorgName}" />
									</td>
								</tr>
								<tr>
									<th><p>类型</p></th>
									<td>
									   <syscode:dictionary name="type" extendProperty="notNull=false" defaultValue="${dto.type}" codeType="CIMS_PARTNERTYPE"
											className="text" type="select"/>
									</td>
									<th><p>地址</p></th>
									<td>
										<input name="address" type="text" class="noborder" notNull="true"
											   maxLength=256 value="${dto.address}" />
									</td>
								</tr>
								<tr>
									<th><p>商户号</p></th>
									<td>
										<input name="commercialNum" type="text" class="noborder"
											   maxLength=32 value="${dto.commercialNum}" />
									</td>
									<th></th>
									<td>
									</td>
								</tr>
								<tr>
									<th><p>备注</p></th>
									<td colspan=3>
										<textarea name="remarks" class="noborder">${dto.remarks}</textarea>
									</td>
								</tr>
							</table>
						</div>
					</div>
			 		<div class="expandToolbar">
					 	<c:if test="${action ne 'view'}">
				 			<span class="submitBtn cims_pointer" onclick="doAddFrom();">提交</span>
				 		</c:if>
				 		<span class="submitBtn cims_pointer" onclick="parent.tabs.close();">关闭</span>
			 		</div>
				</div>
			</div>
		</form>
	<script type="text/javascript" src="<app:contextPath/>/js/cims/cmm.js"></script>
	<script type="text/javascript">
		$(function() {
			checkedInit();
		});
		var action="${action}";
		//新增页面的保存操作
		function doAddFrom(){
			if(!CheckUtil.formCheck("partner_detail")){
				return;
			}
			//序列化 新增页面的form表单数据
			var params=$("#partner_detail").serialize();
			var url;
			if(action=="add"){
				url=contextRootPath+"/paramManage/partner/insertTCMmCooperorg";
			}else if(action=="modify"){
				url=contextRootPath+"/paramManage/partner/updateTCMmCooperorg";
			}
			//通过ajax保存
			jyAjax(
				url,
				params,
				function(msg){
					//新增成功后，
					alert(msg.msg);
					var v_status = msg.status;
		        	if(v_status.indexOf('ok') >-1){
		        		//新增成功后 刷新页面 或 只查询 id为msg.data['id'] 的  数据
// 		        		queryData();
		        		parent.tabs.close()
		        	}
		  	});
		}
	</script>
	</body>
</html>